package cn.ljy.authority.model;

import cn.ljy.common.model.BaseModel;
import cn.ljy.common.model.validate.AddWorkValidation;
import cn.ljy.common.model.validate.UpdateWorkValidation;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@ApiModel(value="系统日志")
@Data
@EqualsAndHashCode(callSuper = false,of = {"id"})
@NoArgsConstructor
public class SysDaily extends BaseModel {
    @NotNull(groups = UpdateWorkValidation.class,message="id不能为空")
    private String id;//主键
//    @NotNull(message = "作者不能为空")
    private SysUser author;//作者
    private SysUser lastAuthor;//最后编辑作者
//    @NotNull(message = "日志类型不能为空")
    private SysDailyType dailyType;//日志类型
    @NotNull(message = "排序不能为空")
    private Integer sort;//排序，升序排列
    @NotNull(groups = AddWorkValidation.class,message="标题图片不能为空")
    private SysFileResource fileResource;//标题图片
//    private String picUrl;//图片
    @Length(min = 2, max = 50, message = "标题长度必须在 {min} - {max} 之间")
    private String title;//标题
    @NotBlank(message = "摘要不能为空")
    private String expert;//摘要
    @NotBlank(message = "内容不能为空")
    private String content;//内容
    private Boolean display;//是否在前台显示
}
